package com.events.testservice.rest.v1.dto;

import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Sales order data transfer object.
 * @author Ashish Sonawane.
 *
 */
@SuppressWarnings("serial")
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public class SalesOrderDto {

	List<ProductDto> product;
	
    private Long salesOrderId;
	
    private String ordername;
	
	public List<ProductDto> getProduct() {
		return product;
	}

	public void setProduct(List<ProductDto> product) {
		this.product = product;
	}

	public Long getSalesOrderId() {
		return salesOrderId;
	}

	public void setSalesOrderId(Long salesOrderId) {
		this.salesOrderId = salesOrderId;
	}

	public String getOrdername() {
		return ordername;
	}

	public void setOrdername(String ordername) {
		this.ordername = ordername;
	}
	
	/**
	 * Builder object for sales order dto.
	 * @author Ashish Sonawane
	 *
	 */
	public static class Builder {
		
        private Long salesOrderId;
        private String ordername;
        List<ProductDto> productList;

        public Builder id(Long salesOrderId) {
            this.salesOrderId = salesOrderId;
            return this;
        }

        public Builder name(String ordername) {
            this.ordername = ordername;
            return this;
        }

        public Builder product(List<ProductDto> productList) {
        	this.productList = productList;
            return this;
    	}

        public SalesOrderDto build() {
            return new SalesOrderDto(this);
        }
        
    }

    private SalesOrderDto(Builder builder) {
        this.salesOrderId = builder.salesOrderId;
        this.ordername = builder.ordername;
        this.product = builder.productList;
    }

}
